home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / CodeWarrior Lite / Metrowerks C⁄C++ Lite / Headers / Universal Headers 2.0.1f / PictUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  5.7 KB  |  157 lines  |  [TEXT/MMCC]

  1. /*
  2.      File:        PictUtils.h
  3.  
  4.      Contains:    Picture Utilities Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __PICTUTILS__
  21. #define __PICTUTILS__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __WINDOWS__
  30. #include <Windows.h>
  31. #endif
  32. /*    #include <Memory.h>                                            */
  33. /*        #include <MixedMode.h>                                    */
  34. /*    #include <Quickdraw.h>                                        */
  35. /*        #include <QuickdrawText.h>                                */
  36. /*    #include <Events.h>                                            */
  37. /*        #include <OSUtils.h>                                    */
  38. /*    #include <Controls.h>                                        */
  39. /*        #include <Menus.h>                                        */
  40.  
  41. #ifndef __PALETTES__
  42. #include <Palettes.h>
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. #if PRAGMA_ALIGN_SUPPORTED
  50. #pragma options align=mac68k
  51. #endif
  52.  
  53. #if PRAGMA_IMPORT_SUPPORTED
  54. #pragma import on
  55. #endif
  56.  
  57.  
  58. enum {
  59.     returnColorTable            = 0x0001,
  60.     returnPalette                = 0x0002,
  61.     recordComments                = 0x0004,
  62.     recordFontInfo                = 0x0008,
  63.     suppressBlackAndWhite        = 0x0010
  64. };
  65.  
  66. enum {
  67. /* color pick methods */
  68.     systemMethod                = 0,                            /* system color pick method */
  69.     popularMethod                = 1,                            /* method that chooses the most popular set of colors */
  70.     medianMethod                = 2,                            /* method that chooses a good average mix of colors */
  71. /* color bank types */
  72.     ColorBankIsCustom            = -1,
  73.     ColorBankIsExactAnd555        = 0,
  74.     ColorBankIs555                = 1
  75. };
  76.  
  77. typedef long PictInfoID;
  78.  
  79. struct CommentSpec {
  80.     short                            count;                        /* number of occurrances of this comment ID */
  81.     short                            ID;                            /* ID for the comment in the picture */
  82. };
  83. typedef struct CommentSpec CommentSpec, *CommentSpecPtr, **CommentSpecHandle;
  84.  
  85. struct FontSpec {
  86.     short                            pictFontID;                    /* ID of the font in the picture */
  87.     short                            sysFontID;                    /* ID of the same font in the current system file */
  88.     long                            size[4];                    /* bit array of all the sizes found (1..127) (bit 0 means > 127) */
  89.     short                            style;                        /* combined style of all occurrances of the font */
  90.     long                            nameOffset;                    /* offset into the fontNamesHdl handle for the font’s name */
  91. };
  92. typedef struct FontSpec FontSpec, *FontSpecPtr, **FontSpecHandle;
  93.  
  94. struct PictInfo {
  95.     short                            version;                    /* this is always zero, for now */
  96.     long                            uniqueColors;                /* the number of actual colors in the picture(s)/pixmap(s) */
  97.     PaletteHandle                    thePalette;                    /* handle to the palette information */
  98.     CTabHandle                        theColorTable;                /* handle to the color table */
  99.     Fixed                            hRes;                        /* maximum horizontal resolution for all the pixmaps */
  100.     Fixed                            vRes;                        /* maximum vertical resolution for all the pixmaps */
  101.     short                            depth;                        /* maximum depth for all the pixmaps (in the picture) */
  102.     Rect                            sourceRect;                    /* the picture frame rectangle (this contains the entire picture) */
  103.     long                            textCount;                    /* total number of text strings in the picture */
  104.     long                            lineCount;                    /* total number of lines in the picture */
  105.     long                            rectCount;                    /* total number of rectangles in the picture */
  106.     long                            rRectCount;                    /* total number of round rectangles in the picture */
  107.     long                            ovalCount;                    /* total number of ovals in the picture */
  108.     long                            arcCount;                    /* total number of arcs in the picture */
  109.     long                            polyCount;                    /* total number of polygons in the picture */
  110.     long                            regionCount;                /* total number of regions in the picture */
  111.     long                            bitMapCount;                /* total number of bitmaps in the picture */
  112.     long                            pixMapCount;                /* total number of pixmaps in the picture */
  113.     long                            commentCount;                /* total number of comments in the picture */
  114.     long                            uniqueComments;                /* the number of unique comments in the picture */
  115.     CommentSpecHandle                commentHandle;                /* handle to all the comment information */
  116.     long                            uniqueFonts;                /* the number of unique fonts in the picture */
  117.     FontSpecHandle                    fontHandle;                    /* handle to the FontSpec information */
  118.     Handle                            fontNamesHandle;            /* handle to the font names */
  119.     long                            reserved1;
  120.     long                            reserved2;
  121. };
  122. typedef struct PictInfo PictInfo;
  123.  
  124. typedef PictInfo *PictInfoPtr, **PictInfoHandle;
  125.  
  126. extern pascal OSErr GetPictInfo(PicHandle thePictHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  127.  THREEWORDINLINE(0x303C, 0x0800, 0xA831);
  128. extern pascal OSErr GetPixMapInfo(PixMapHandle thePixMapHandle, PictInfo *thePictInfo, short verb, short colorsRequested, short colorPickMethod, short version)
  129.  THREEWORDINLINE(0x303C, 0x0801, 0xA831);
  130. extern pascal OSErr NewPictInfo(PictInfoID *thePictInfoID, short verb, short colorsRequested, short colorPickMethod, short version)
  131.  THREEWORDINLINE(0x303C, 0x0602, 0xA831);
  132. extern pascal OSErr RecordPictInfo(PictInfoID thePictInfoID, PicHandle thePictHandle)
  133.  THREEWORDINLINE(0x303C, 0x0403, 0xA831);
  134. extern pascal OSErr RecordPixMapInfo(PictInfoID thePictInfoID, PixMapHandle thePixMapHandle)
  135.  THREEWORDINLINE(0x303C, 0x0404, 0xA831);
  136. extern pascal OSErr RetrievePictInfo(PictInfoID thePictInfoID, PictInfo *thePictInfo, short colorsRequested)
  137.  THREEWORDINLINE(0x303C, 0x0505, 0xA831);
  138. extern pascal OSErr DisposePictInfo(PictInfoID thePictInfoID)
  139.  THREEWORDINLINE(0x303C, 0x0206, 0xA831);
  140. #if OLDROUTINENAMES
  141. #define DisposPictInfo(thePictInfoID) DisposePictInfo(thePictInfoID)
  142. #endif
  143.  
  144. #if PRAGMA_IMPORT_SUPPORTED
  145. #pragma import off
  146. #endif
  147.  
  148. #if PRAGMA_ALIGN_SUPPORTED
  149. #pragma options align=reset
  150. #endif
  151.  
  152. #ifdef __cplusplus
  153. }
  154. #endif
  155.  
  156. #endif /* __PICTUTILS__ */
  157.